public class Login {
    private String userName = "admin";
    private String passWord = "123456";

    public void loginInfo(String userName, String passWord) {
        if(!this.userName.equals(userName)) {
            throw new UserNameErrorException("用户名错误");
            //System.out.println("用户名错误");
            //return;
        }
        if(!this.passWord.equals(passWord)) {
            throw new PassWordException("用户名错误");
            //System.out.println("密码错误");
            //return;
        }
        System.out.println("登陆成功");
    }

    public static void main(String[] args) {
        Login logIn = new Login();
        logIn.loginInfo("admin2","12345");
    }
}
